package
{
	/**
	 * 位图的小切块类 
	 * @author fujuxuan
	 * 
	 */
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.events.MouseEvent;

	public class BMDiamond extends Sprite
	{
		private var bmdata:BitmapData;
		private var bmdMap:Bitmap;
		
		private static const diamondWith:uint = 80;		//小切块的宽
		private static const diamondHeight:uint = 80;	//小切块的高
		private static const diamondX:int = -40;	//小切块的x坐标
		private static const diamondY:int = -40;	//小切块的y坐标
		

		public function BMDiamond(bmdata:BitmapData)
		{
			this.width = diamondWith;
			this.height = diamondHeight;
			this.bmdata = bmdata;
	
			bmdMap = new Bitmap(bmdata);
			bmdMap.x = diamondX;
			bmdMap.y = diamondY;
			addChild(bmdMap);
			this.addEventListener(MouseEvent.CLICK,mouseClickListener);
		}
		
		// 鼠标点击响应函数
		private function mouseClickListener(event:MouseEvent):void{
			this.rotation += 90;
			trace(this.rotation);
		}
		
	}
}